package com.like.adapter;

import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.like.fragment.BaseFragment;
import com.like.fragment.MyMsgFragment;
import com.like.fragment.SysMsgFragment;

public class MsgPagerAdapter extends FragmentPagerAdapter {

    private MyMsgFragment mMyFragment = new MyMsgFragment();
    private SysMsgFragment mSysFragment = new SysMsgFragment();

    private BaseFragment[] fragments;

    public MsgPagerAdapter(FragmentManager fm) {
        super(fm);
        fragments = new BaseFragment[]{mMyFragment, mSysFragment};
    }

    @Override
    public BaseFragment getItem(int position) {
        return fragments[position];
    }

    @Override
    public int getCount() {
        return fragments.length;
    }
}
